/*****************************************************************************************
This file is a part of Arise library.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

Arise Engine		KeyAction.h

					E-mail:		arise_engine@mail.ru

					Origin by:	DK Engine 0.019,
								dev (avon.dn.ua@gmail.com), Agressor (agress0r@mail.ru)

created:			03.01.2004
last changes:		27.02.2008
*****************************************************************************************/
#pragma once

typedef void (*FUNCTION_POINTER)();


class KeyAction
{
private:

	bool m_is_pressed;
	UINT m_key_id;
	UINT m_num_actions; 
	UINT m_counter;
	
	std::vector<FUNCTION_POINTER> m_actions;

public:
	KeyAction(int gloabal_key_id);
	~KeyAction();

	void Update(bool is_key_pressed);
	void Release();
	void AddAction(void action());

	UINT GetKeyId() const {return m_key_id;}
};
